package ai.loa;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public final class Parameters {
	private static String fileProperties = "properties";
	public static int depthNegamax;
	public static int algorithm;
	public static int thinkingTime;
	public static int thinkingTimeMain;
	public static int thinkingTimePublic;
	public static double concentrationWeight;
	public static double centralizationWeight;
	public static double quadWeight;
	public static int windowSize;
	public static int forewardPruningFactor;
	public static double mobility;
	public static double connectednessWeight;
	public static double centerOfMassPosition;
	public static double wallWeight;
	public static double rectangle;

	static {
		try {

			Properties props = new Properties();
			props.load(new FileInputStream(fileProperties));

			depthNegamax = Integer.parseInt(props.getProperty("depthNegamax"));
			algorithm = Integer.parseInt(props.getProperty("algorithm"));
			if (Integer.parseInt(props.getProperty("thinkingTime")) != -1) {
				thinkingTime = Integer.parseInt(props
						.getProperty("thinkingTime"));
			} else {
				thinkingTime = Integer.MAX_VALUE;
			}
			thinkingTimeMain = thinkingTime;
			thinkingTimePublic = thinkingTime;
			centralizationWeight = Double.parseDouble(props
					.getProperty("centralizationWeight"));
			concentrationWeight = Double.parseDouble(props
					.getProperty("concentrationWeight"));
			quadWeight = Double.parseDouble(props.getProperty("quadWeight"));

			mobility = Double.parseDouble(props.getProperty("mobilityWeight"));

			windowSize = Integer.parseInt(props.getProperty("windowSize"));
			forewardPruningFactor = Integer.parseInt(props
					.getProperty("forewardPruningFactor"));
			connectednessWeight = Double.parseDouble(props
					.getProperty("connectednessWeight"));
			centerOfMassPosition = Double.parseDouble(props
					.getProperty("centerOfMassPosition"));
			wallWeight = Double.parseDouble(props.getProperty("wallWeight"));
			rectangle = Double.parseDouble(props.getProperty("rectangle"));

			System.out.println("depth: " + depthNegamax);
			System.out.println("algorithm: " + algorithm);
			System.out.println("thinkingTime: " + thinkingTime);
			System.out.println("centralizationWaight: " + centralizationWeight);
			System.out.println("concentrationWeight: " + concentrationWeight);
			System.out.println("quadWeight: " + quadWeight);
			System.out.println("rectangle: " + rectangle);

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	// public static void main(String[] args) {
	// new Parameters();
	// int x = 12 ^ 13;
	// System.out.println(x);
	// }

}
